/**
 * 角色api
 */
import { PostRequestApi, PutRequestApi } from '@/utils/api/RequestApi'

export const ROLE_API_PRE_SUFFER = '/role/'

import { Role, RoleQuery } from '@/entity/system/role'

/**
 * 查询角色下拉框
 */
export function roleSelected(query: RoleQuery) {
  return new PostRequestApi<Array<Role>>(ROLE_API_PRE_SUFFER + 'selected', query).get()
}

/**
 * 新增角色
 */
export function add(data: Role) {
  return new PostRequestApi(ROLE_API_PRE_SUFFER, data).get()
}

/**
 * 修改角色
 */
export function update(data: Role) {
  return new PutRequestApi(ROLE_API_PRE_SUFFER, data).get()
}
